﻿using Moq;
using Soundteller.Common.Tests;
using Soundteller.Visual.Model;
using Soundteller.Visual.Repositories.Interfaces;
using Soundteller.Visual.Services;
using Soundteller.Visual.Services.Interfaces;
using System.Collections.Generic;

namespace Soundteller.Visual.Tests.Unit.Services.DrawerSpecifications
{
    public abstract class WhenDrawTestBase : TestBase
    {
        protected IDrawer Drawer { get; private set; }
        protected Mock<IGraphicBufferRepository> GraphicBufferRepository { get; private set; }
        protected abstract GraphicBase Graphic { get; }

        protected override void Arrange()
        {
            base.Arrange();

            GraphicBufferRepository = new Mock<IGraphicBufferRepository>();

            Drawer = new Drawer(GraphicBufferRepository.Object);
        }

        protected override void Act()
        {
            Drawer.Draw(Graphic);
        }
    }

    public abstract class WhenDrawListTestBase : TestBase
    {
        protected IDrawer Drawer { get; private set; }
        protected Mock<IGraphicBufferRepository> GraphicBufferRepository { get; private set; }
        protected abstract IEnumerable<GraphicBase> Graphics { get; }

        protected override void Arrange()
        {
            base.Arrange();

            GraphicBufferRepository = new Mock<IGraphicBufferRepository>();

            Drawer = new Drawer(GraphicBufferRepository.Object);
        }

        protected override void Act()
        {
            Drawer.Draw(Graphics);
        }
    }
}
